package com.dfbz.springboot_project.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Objects;

@Entity
public class Privilege {
    private Integer privilegeId;
    private String privilegeName;
    private String privateUrl;

    @Id
    @Column(name = "privilege_id", nullable = false)
    public Integer getPrivilegeId() {
        return privilegeId;
    }

    public void setPrivilegeId(Integer privilegeId) {
        this.privilegeId = privilegeId;
    }

    @Basic
    @Column(name = "privilege_name", nullable = true, length = 50)
    public String getPrivilegeName() {
        return privilegeName;
    }

    public void setPrivilegeName(String privilegeName) {
        this.privilegeName = privilegeName;
    }

    @Basic
    @Column(name = "private_url", nullable = true, length = 100)
    public String getPrivateUrl() {
        return privateUrl;
    }

    public void setPrivateUrl(String privateUrl) {
        this.privateUrl = privateUrl;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Privilege privilege = (Privilege) o;
        return privilegeId == privilege.privilegeId &&
                Objects.equals(privilegeName, privilege.privilegeName) &&
                Objects.equals(privateUrl, privilege.privateUrl);
    }

    @Override
    public int hashCode() {
        return Objects.hash(privilegeId, privilegeName, privateUrl);
    }
}
